	
		var warndown=5;
		
		var downreload=5;

			//设置延时
		function settime_warn(val) { 
				if (warndown == 0) {
					val.alert("close");
					$("#send").attr("disabled", false);
					$("#card_read").attr('disabled',false);
					$("#confirm_").attr("disabled", false); 
					$(".btn_fs").attr("disabled",false);
					warndown = 5; 
				} else { 
					warndown--; 
					//$("#warn_").html(warndown);
					setTimeout(function() { 
					settime_warn(val);
					},1000);
				} 
					
		}
		
		function settime_down(val,down) { 
			if (down == 0) {
				val.alert("close");
				$("#send").attr("disabled", false);
				$("#card_read").attr('disabled',false);
				$("#confirm_").attr("disabled", false); 
				$(".btn_fs").attr("disabled",false);
				//warndown = 5; 
			} else { 
				down--; 
				//$("#warn_").html(down);
				setTimeout(function() {
					settime_down(val,down);
				},1000);
			}
				
		}


		function settime_quit(val,quit) { 
			var fs=$("#input_fs").val();
			
			if (quit == 0) {
				val.alert("close");
				if(fs){
					window.location.reload();
				}
				
				//warndown = 5; 
			} else { 
				quit--; 
				
				if(fs){
					$("#warn_num").html("");
				}else{
					$("#warn_num").html(quit);
					setTimeout(function() {
						settime_quit(val,quit);
					},1000);
				}
			}
				
	}
		


	
		
		

		
		function close_warn(){
			
			warndown=0;
			
		}
		
		
		//设置延时
		function settime_yzm(val) { 
				if (warndown == 0) {
					val.remove();
					$("#send").attr("disabled", false);
					$("#card_read").attr('disabled',false);
					$("#confirm_").attr("disabled", false); 
					$(".btn_fs").attr("disabled",false);
                    $("#confirm_agent").attr("disabled",false);

                    warndown = 5;
				} else { 
					warndown--; 
					//$("#warn_").html(warndown);
					setTimeout(function() { 
						settime_yzm(val);
					},1000);
				} 
					
		}
		
		function settime_reload(val) { 
			if (downreload == 0) {
                downreload==5;
				window.location.reload();
			} else { 
				downreload--; 
				//$("#warn_").html(warndown);
				setTimeout(function() { 
					settime_reload(val);
				},1000);
			} 
				
		}

        function homepage() {
            if (downreload == 0) {
                downreload==5;
                $(".alert").remove();
                back();
            } else {
                downreload--;
                //$("#warn_").html(warndown);
                setTimeout(function() {
                    homepage();
                },1000);
            }
        }

		//病案号
		function settime_banum(val,down) { 
			
			
			if (down == 0) { 
				val.remove();
				$("#send").attr("disabled", false);
				$("#card_read").attr('disabled',false);
				$("#confirm_").attr("disabled", false); 
				$(".btn_fs").attr("disabled",false);
				down = 5; 
			}else { 
				down--; 
				//$("#warn_").html(warndown);
				setTimeout(function() { 
					settime_banum(val,down);
				},1000);
			}
				
	}
		
		
	/* 	function close_warn(){
			$("#btn_warn").alert("close");
			warndown=5;
			$("#send").attr("disabled", false);
			$("#confirm_").attr("disabled", false); 
			$("#card_read").attr('disabled',false);
			$("#print").attr("disabled",false);
		}
	 */
	 function  click_dvd(){
	 	var check=$("#dvdChoice").val();
	 	if(check==1){
	 		$("#dvdChoice").val(0);
	 	}else{
	 		$("#dvdChoice").val(1);
	 	}
	 }
	 
	//单选方法	
		function  click_check(id){
				var check_this=$("#"+id);
				var check_=check_this.attr("id");
				var check_type=check_.split("_")[1];
				var check_id = check_.split("_")[2];
				var input_check=$("#"+check_type+"_checkbox_"+check_id);
			//	alert(input_check.attr("id")+"--"+input_check.attr('name'));
				
	            $(':checkbox[id^="'+check_type+'_checkbox_"]').removeAttr('checked');
	            input_check.prop("checked",true);
	            input_check.attr("checked",true);
	                 
		}
		
		//单击切换状态
		function  click_choice(id){
				var check_this=$("#"+id);
				var check_=check_this.attr("id");
				var check_type=check_.split("_")[1];
				var check_id = check_.split("_")[2];
				var input_check=$("#"+check_type+"_checkbox_"+check_id);
				var differ=check_this.attr("differ");
				/*if(differ<15){
					if(input_check.attr("checked")== 'checked'){
						input_check.prop("checked",false);
			            input_check.attr("checked",false);
					}
					$(".alert_warn_").remove();
					$("#myModal").append("<div class='alert_warn_banum modal'  onclick='closeBanum()'><div class='warn_div_banum'><font class='font12' id='warn'>该病案不能打印！</font></div></div>");
					settime_banum($(".alert_warn_banum"),5);
					//settime_warn($("#btn_warn"));
				}else{*/
					if(input_check.attr("checked")== 'checked'){
						input_check.prop("checked",false);
			            input_check.attr("checked",false);
					}else{
						input_check.prop("checked",true);
			            input_check.attr("checked",true);
					}
				/*}*/
		}
		
		
		//多选方法	
		function  click_check_dvd(id){
				var check_this=$("#"+id);
				var check_=check_this.attr("id");
				var check_type=check_.split("_")[1];
				var check_id = check_.split("_")[2];
				var input_check=$("#"+check_type+"_checkbox_"+check_id);
			//	alert(input_check.attr("checked"));
				if(input_check.attr("checked")){
					input_check.prop("checked",false);
	                input_check.attr("checked",false);
				}else{
					input_check.prop("checked",true);
	            	input_check.attr("checked",true);
				}
	           
		}	
	$(function(){
	
		$("#btnwarn").click(function(){
			$("#modal_warn").modal();
		});


	
	
	//刻录界面打开	
		$("#issueDvd").click(function(){
			$("#myModal").attr("class","modal modal_dy hide");
			$("#dvdModal").attr("class","modal modal_dvd ");
		
		});
	//刻录界面关闭，返回打印界面	
		$("#modal_dvd_colse").click(function(){
			$("#myModal").attr("class","modal modal_dy ");
			$("#dvdModal").attr("class","modal modal_dy hide");
		});
		
	//刻录界面关闭，返回打印界面	
		$("#modal_payment_colse").click(function(){
			$("#paymentModal").attr("class","modal modal_dy hide");
			$("#myModal").attr("class","modal modal_dy ");
		});
		$("#modal_payment_colse_btn").click(function(){
			$("#paymentModal").attr("class","modal modal_dy hide");
			$("#myModal").attr("class","modal modal_dy ");
		});
		
		$("#modal_dy_colse").click(function(){
			//$("#myModal").attr("class","modal modal_dy hide");
			window.location.reload();
		});
		
				

		
		
	
			
	//实现点击指定div外区域数字框消失
		/*$('body').click(function(e) {
			    var target = $(e.target);
			    // 如果#overlay或者#btn下面还有子元素，可使用
			    // !target.is('#btn *') && !target.is('#overlay *')
			    if(!target.is('#div_key *') && !target.is('#div_validation *')) {
			       if ( $('#div_validation').is(':visible') ) 
			      		 $('#div_key').attr("class","modal_key modal hidden");
			    }
			});*/
	
	
	});


	